package cn.gson.springboot.model.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.alibaba.fastjson.JSONArray;

import cn.gson.springboot.model.pojos.DoctorsAdvice;

@Mapper
public interface AdviceMappers {
	
	//查询医嘱所有
	public JSONArray selectAdviceAll(@Param("clinicname")String clinicname);
	
	//医嘱核医嘱详情查询（得到护士界面中的领药情况）
	public JSONArray selectAdviceDetailsBYclinic();
	public JSONArray selectapplydrugAll();

	//查询未执行的医嘱
	public JSONArray selectNotAdviceDetails(@Param("clinicname")String clinicname,
			@Param("doctorname")String doctorname,@Param("drugname")String drugname);
	
	//初始化医疗卡
	public JSONArray selectnotAdviceByclinic();
	
	//根据主键修改状态为1
	public void updateAdviceMoneyStatus(@Param("docadviceid")Integer docadviceid);
	
	//修改医嘱主表的状态为2
	public void updateadvapplyStatus(@Param("doctype")Integer doctype,
				@Param("docadviceid")Integer docadviceid);
	
	//根据病程记录查询，用于是否已经执行了，来判断该条医嘱是否要停用
	public JSONArray selectAdviceIfStop(@Param("hospid")String hospid);
	
	//根据医嘱id查询
	public DoctorsAdvice selectadvicebyid(@Param("docid") Integer docid);
	
	//根据医嘱id修改
	public void updateAdvice(@Param("docadvice_conent")String docadvice_conent,@Param("docadviceid") Integer docadviceid);
	
	//查询库存
	public JSONArray selectInhospital_storageBydrug_number(@Param("drug_number")Integer drug_number);
}
